home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / idl / nsISchema.idl < prev    next >
Text File  |  2006-05-08  |  14KB  |  352 lines

  1. /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /* ***** BEGIN LICENSE BLOCK *****
  3.  * Version: MPL 1.1/GPL 2.0/LGPL 2.1
  4.  *
  5.  * The contents of this file are subject to the Mozilla Public License Version
  6.  * 1.1 (the "License"); you may not use this file except in compliance with
  7.  * the License. You may obtain a copy of the License at
  8.  * http://www.mozilla.org/MPL/
  9.  *
  10.  * Software distributed under the License is distributed on an "AS IS" basis,
  11.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  12.  * for the specific language governing rights and limitations under the
  13.  * License.
  14.  *
  15.  * The Original Code is Mozilla.
  16.  *
  17.  * The Initial Developer of the Original Code is
  18.  * Netscape Communications.
  19.  * Portions created by the Initial Developer are Copyright (C) 2001
  20.  * the Initial Developer. All Rights Reserved.
  21.  *
  22.  * Contributor(s):
  23.  *   Vidur Apparao <vidur@netscape.com> (original author)
  24.  *
  25.  * Alternatively, the contents of this file may be used under the terms of
  26.  * either the GNU General Public License Version 2 or later (the "GPL"), or
  27.  * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  28.  * in which case the provisions of the GPL or the LGPL are applicable instead
  29.  * of those above. If you wish to allow use of your version of this file only
  30.  * under the terms of either the GPL or the LGPL, and not to allow others to
  31.  * use your version of this file under the terms of the MPL, indicate your
  32.  * decision by deleting the provisions above and replace them with the notice
  33.  * and other provisions required by the GPL or the LGPL. If you do not delete
  34.  * the provisions above, a recipient may use your version of this file under
  35.  * the terms of any one of the MPL, the GPL or the LGPL.
  36.  *
  37.  * ***** END LICENSE BLOCK ***** */
  38.  
  39. #include "nsISupports.idl"
  40. #include "nsIWebServiceErrorHandler.idl"
  41.  
  42. interface nsISchema;
  43. interface nsISchemaType;
  44. interface nsISchemaSimpleType;
  45. interface nsISchemaBuiltinType;
  46. interface nsISchemaListType;
  47. interface nsISchemaUnionType;
  48. interface nsISchemaRestrictionType;
  49. interface nsISchemaComplexType;
  50. interface nsISchemaParticle;
  51. interface nsISchemaModelGroup;
  52. interface nsISchemaAnyParticle;
  53. interface nsISchemaElement;
  54. interface nsISchemaAttributeComponent;
  55. interface nsISchemaAttribute;
  56. interface nsISchemaAttributeGroup;
  57. interface nsISchemaAnyAttribute;
  58. interface nsISchemaFacet;
  59.  
  60. /**
  61.  * The collection of loaded schemas. If a schema references other 
  62.  * schemas (generally through an import), these will be included
  63.  * in the corresponding collection. 
  64.  */
  65. [scriptable, uuid(427c5511-941b-48c0-9abc-8ec9ea5d964b)]
  66. interface nsISchemaCollection : nsISupports {
  67.   nsISchema getSchema(in AString targetNamespace);
  68.   nsISchemaElement getElement(in AString name, in AString aNamespace);
  69.   nsISchemaAttribute getAttribute(in AString name, in AString aNamespace);
  70.   nsISchemaType getType(in AString name, in AString aNamespace);
  71. };
  72.  
  73. [scriptable, uuid(5caaa64e-e191-11d8-842a-000393b6661a)]
  74. interface nsISchemaComponent : nsISupports {
  75.   readonly attribute AString targetNamespace;
  76.   void resolve(in nsIWebServiceErrorHandler aErrorHandler);
  77.   void clear();
  78. };
  79.  
  80. [scriptable, uuid(3c14a021-6f4e-11d5-9b46-000064657374)]
  81. interface nsISchema : nsISchemaComponent {
  82.   /* Is this necessary? */
  83.   readonly attribute AString schemaNamespace;
  84.  
  85.   readonly attribute PRUint32 typeCount;
  86.   nsISchemaType getTypeByIndex(in PRUint32 index);
  87.   nsISchemaType getTypeByName(in AString name);
  88.  
  89.   readonly attribute PRUint32 attributeCount;
  90.   nsISchemaAttribute getAttributeByIndex(in PRUint32 index);
  91.   nsISchemaAttribute getAttributeByName(in AString name);
  92.  
  93.   readonly attribute PRUint32 elementCount;
  94.   nsISchemaElement getElementByIndex(in PRUint32 index);
  95.   nsISchemaElement getElementByName(in AString name);
  96.   
  97.   readonly attribute PRUint32 attributeGroupCount;
  98.   nsISchemaAttributeGroup getAttributeGroupByIndex(in PRUint32 index);
  99.   nsISchemaAttributeGroup getAttributeGroupByName(in AString name);
  100.  
  101.   readonly attribute PRUint32 modelGroupCount;
  102.   nsISchemaModelGroup getModelGroupByIndex(in PRUint32 index);
  103.   nsISchemaModelGroup getModelGroupByName(in AString name);
  104.  
  105.   readonly attribute nsISchemaCollection collection;
  106. };
  107.  
  108. [scriptable, uuid(3c14a022-6f4e-11d5-9b46-000064657374)]
  109. interface nsISchemaType : nsISchemaComponent {
  110.   const unsigned short SCHEMA_TYPE_SIMPLE = 1;
  111.   const unsigned short SCHEMA_TYPE_COMPLEX = 2;
  112.   const unsigned short SCHEMA_TYPE_PLACEHOLDER = 3;
  113.  
  114.   readonly attribute AString name;
  115.   readonly attribute unsigned short schemaType;
  116. };
  117.  
  118. [scriptable, uuid(3c14a023-6f4e-11d5-9b46-000064657374)]
  119. interface nsISchemaSimpleType : nsISchemaType {
  120.   const unsigned short SIMPLE_TYPE_BUILTIN = 1;
  121.   const unsigned short SIMPLE_TYPE_LIST = 2;
  122.   const unsigned short SIMPLE_TYPE_UNION = 3;
  123.   const unsigned short SIMPLE_TYPE_RESTRICTION = 4;
  124.  
  125.   readonly attribute unsigned short simpleType;
  126. };
  127.  
  128. [scriptable, uuid(3c14a024-6f4e-11d5-9b46-000064657374)]
  129. interface nsISchemaBuiltinType : nsISchemaSimpleType {
  130.   const unsigned short BUILTIN_TYPE_ANYTYPE = 1;
  131.   const unsigned short BUILTIN_TYPE_STRING = 2;
  132.   const unsigned short BUILTIN_TYPE_NORMALIZED_STRING = 3;
  133.   const unsigned short BUILTIN_TYPE_TOKEN = 4;
  134.   const unsigned short BUILTIN_TYPE_BYTE = 5;
  135.   const unsigned short BUILTIN_TYPE_UNSIGNEDBYTE = 6;
  136.   const unsigned short BUILTIN_TYPE_BASE64BINARY = 7;
  137.   const unsigned short BUILTIN_TYPE_HEXBINARY = 8;
  138.   const unsigned short BUILTIN_TYPE_INTEGER = 9;
  139.   const unsigned short BUILTIN_TYPE_POSITIVEINTEGER = 10;
  140.   const unsigned short BUILTIN_TYPE_NEGATIVEINTEGER = 11;
  141.   const unsigned short BUILTIN_TYPE_NONNEGATIVEINTEGER = 12;
  142.   const unsigned short BUILTIN_TYPE_NONPOSITIVEINTEGER = 13;
  143.   const unsigned short BUILTIN_TYPE_INT = 14;
  144.   const unsigned short BUILTIN_TYPE_UNSIGNEDINT = 15;
  145.   const unsigned short BUILTIN_TYPE_LONG = 16;
  146.   const unsigned short BUILTIN_TYPE_UNSIGNEDLONG = 17;
  147.   const unsigned short BUILTIN_TYPE_SHORT = 18;
  148.   const unsigned short BUILTIN_TYPE_UNSIGNEDSHORT = 19;
  149.   const unsigned short BUILTIN_TYPE_DECIMAL = 20;
  150.   const unsigned short BUILTIN_TYPE_FLOAT = 21;
  151.   const unsigned short BUILTIN_TYPE_DOUBLE = 22;
  152.   const unsigned short BUILTIN_TYPE_BOOLEAN = 23;
  153.   const unsigned short BUILTIN_TYPE_TIME = 24;
  154.   const unsigned short BUILTIN_TYPE_DATETIME = 25;
  155.   const unsigned short BUILTIN_TYPE_DURATION = 26;
  156.   const unsigned short BUILTIN_TYPE_DATE = 27;
  157.   const unsigned short BUILTIN_TYPE_GMONTH = 28;
  158.   const unsigned short BUILTIN_TYPE_GYEAR = 29;
  159.   const unsigned short BUILTIN_TYPE_GYEARMONTH = 30;
  160.   const unsigned short BUILTIN_TYPE_GDAY = 31;
  161.   const unsigned short BUILTIN_TYPE_GMONTHDAY = 32;
  162.   const unsigned short BUILTIN_TYPE_NAME = 33;
  163.   const unsigned short BUILTIN_TYPE_QNAME = 34;
  164.   const unsigned short BUILTIN_TYPE_NCNAME = 35;
  165.   const unsigned short BUILTIN_TYPE_ANYURI = 36;
  166.   const unsigned short BUILTIN_TYPE_LANGUAGE = 37;
  167.   const unsigned short BUILTIN_TYPE_ID = 38;
  168.   const unsigned short BUILTIN_TYPE_IDREF = 39;
  169.   const unsigned short BUILTIN_TYPE_IDREFS = 40;
  170.   const unsigned short BUILTIN_TYPE_ENTITY = 41;
  171.   const unsigned short BUILTIN_TYPE_ENTITIES = 42;
  172.   const unsigned short BUILTIN_TYPE_NOTATION = 43;
  173.   const unsigned short BUILTIN_TYPE_NMTOKEN = 44;
  174.   const unsigned short BUILTIN_TYPE_NMTOKENS = 45;
  175.  
  176.   readonly attribute unsigned short builtinType;
  177. };
  178.  
  179. [scriptable, uuid(3c14a025-6f4e-11d5-9b46-000064657374)]
  180. interface nsISchemaListType : nsISchemaSimpleType {
  181.   readonly attribute nsISchemaSimpleType listType;
  182. };
  183.  
  184. [scriptable, uuid(3c14a026-6f4e-11d5-9b46-000064657374)]
  185. interface nsISchemaUnionType : nsISchemaSimpleType {
  186.   readonly attribute PRUint32 unionTypeCount;
  187.   nsISchemaSimpleType getUnionType(in PRUint32 index);
  188. };
  189.  
  190. [scriptable, uuid(3c14a027-6f4e-11d5-9b46-000064657374)]
  191. interface nsISchemaRestrictionType : nsISchemaSimpleType {
  192.   readonly attribute nsISchemaSimpleType baseType;
  193.   readonly attribute PRUint32 facetCount;
  194.   nsISchemaFacet getFacet(in PRUint32 index);
  195. };
  196.  
  197. [scriptable, uuid(3c14a028-6f4e-11d5-9b46-000064657374)]
  198. interface nsISchemaComplexType : nsISchemaType {
  199.   const unsigned short CONTENT_MODEL_EMPTY = 1;
  200.   const unsigned short CONTENT_MODEL_SIMPLE = 2;
  201.   const unsigned short CONTENT_MODEL_ELEMENT_ONLY = 3;
  202.   const unsigned short CONTENT_MODEL_MIXED = 4;
  203.  
  204.   const unsigned short DERIVATION_EXTENSION_SIMPLE = 1;
  205.   const unsigned short DERIVATION_RESTRICTION_SIMPLE = 2;
  206.   const unsigned short DERIVATION_EXTENSION_COMPLEX = 3;
  207.   const unsigned short DERIVATION_RESTRICTION_COMPLEX = 4;  
  208.   const unsigned short DERIVATION_SELF_CONTAINED = 5; // Restriction of ur-type
  209.  
  210.   readonly attribute unsigned short contentModel;
  211.   readonly attribute unsigned short derivation;
  212.   readonly attribute nsISchemaType baseType;
  213.  
  214.   // For complex types that are derivations of simple types or of
  215.   // complex types that are themselves derivations of simple types
  216.   // i.e. derivation is either DERIVATION_RESTRICTION_SIMPLE or
  217.   // DERIVATION_EXTENSION_SIMPLE.
  218.   readonly attribute nsISchemaSimpleType simpleBaseType; 
  219.  
  220.   readonly attribute nsISchemaModelGroup modelGroup;
  221.   
  222.   readonly attribute PRUint32 attributeCount;
  223.   nsISchemaAttributeComponent getAttributeByIndex(in PRUint32 index);
  224.   nsISchemaAttributeComponent getAttributeByName(in AString name);
  225.  
  226.   readonly attribute boolean abstract;
  227.   
  228.   readonly attribute boolean isArray;
  229.   readonly attribute nsISchemaType arrayType;
  230.   readonly attribute PRUint32 arrayDimension;
  231. };
  232.  
  233. [scriptable, uuid(3c14a029-6f4e-11d5-9b46-000064657374)]
  234. interface nsISchemaParticle : nsISchemaComponent {
  235.   const unsigned short PARTICLE_TYPE_ELEMENT = 1;
  236.   const unsigned short PARTICLE_TYPE_MODEL_GROUP = 2;
  237.   const unsigned short PARTICLE_TYPE_ANY = 3;
  238.  
  239.   const PRUint32 OCCURRENCE_UNBOUNDED = 0xFFFFFFFF;
  240.  
  241.   readonly attribute AString name;
  242.   readonly attribute unsigned short particleType;
  243.  
  244.   readonly attribute PRUint32 minOccurs;
  245.   readonly attribute PRUint32 maxOccurs;  
  246. };
  247.  
  248. [scriptable, uuid(3c14a02a-6f4e-11d5-9b46-000064657374)]
  249. interface nsISchemaModelGroup : nsISchemaParticle {
  250.   const unsigned short COMPOSITOR_ALL = 1;
  251.   const unsigned short COMPOSITOR_SEQUENCE = 2;
  252.   const unsigned short COMPOSITOR_CHOICE = 3;
  253.  
  254.   readonly attribute unsigned short compositor;
  255.  
  256.   readonly attribute PRUint32 particleCount;
  257.   nsISchemaParticle getParticle(in PRUint32 index);
  258.  
  259.   // Get named element definition for a named element that is
  260.   // part of this model group or part of a nested model group.
  261.   nsISchemaElement getElementByName(in AString name);
  262. };
  263.  
  264. [scriptable, uuid(3c14a02b-6f4e-11d5-9b46-000064657374)]
  265. interface nsISchemaAnyParticle : nsISchemaParticle {
  266.   const unsigned short PROCESS_STRICT = 1;
  267.   const unsigned short PROCESS_SKIP = 2;
  268.   const unsigned short PROCESS_LAX = 3;
  269.  
  270.   readonly attribute unsigned short process;
  271.   readonly attribute AString namespace;
  272. };
  273.  
  274. [scriptable, uuid(3c14a02c-6f4e-11d5-9b46-000064657374)]
  275. interface nsISchemaElement : nsISchemaParticle {
  276.   readonly attribute nsISchemaType type;
  277.  
  278.   readonly attribute AString defaultValue;
  279.   readonly attribute AString fixedValue;
  280.  
  281.   readonly attribute boolean nillable;
  282.   readonly attribute boolean abstract; 
  283. };
  284.  
  285. [scriptable, uuid(3c14a02d-6f4e-11d5-9b46-000064657374)]
  286. interface nsISchemaAttributeComponent : nsISchemaComponent {
  287.   const unsigned short COMPONENT_TYPE_ATTRIBUTE = 1;
  288.   const unsigned short COMPONENT_TYPE_GROUP = 2;
  289.   const unsigned short COMPONENT_TYPE_ANY = 3;
  290.   
  291.   readonly attribute AString name;
  292.   readonly attribute unsigned short componentType;
  293. };
  294.  
  295. [scriptable, uuid(3c14a02e-6f4e-11d5-9b46-000064657374)]
  296. interface nsISchemaAttribute : nsISchemaAttributeComponent {
  297.   const unsigned short USE_OPTIONAL = 1;
  298.   const unsigned short USE_PROHIBITED = 2;
  299.   const unsigned short USE_REQUIRED = 3;
  300.  
  301.   readonly attribute nsISchemaSimpleType type;
  302.  
  303.   readonly attribute AString defaultValue;
  304.   readonly attribute AString fixedValue;
  305.   readonly attribute unsigned short use;
  306. };
  307.  
  308. [scriptable, uuid(3c14a02f-6f4e-11d5-9b46-000064657374)]
  309. interface nsISchemaAttributeGroup : nsISchemaAttributeComponent {
  310.   readonly attribute PRUint32 attributeCount;
  311.   nsISchemaAttributeComponent getAttributeByIndex(in PRUint32 index);
  312.   nsISchemaAttributeComponent getAttributeByName(in AString name);
  313. };
  314.  
  315. [scriptable, uuid(3c14a030-6f4e-11d5-9b46-000064657374)]
  316. interface nsISchemaAnyAttribute : nsISchemaAttributeComponent {
  317.   const unsigned short PROCESS_STRICT = 1;
  318.   const unsigned short PROCESS_SKIP = 2;
  319.   const unsigned short PROCESS_LAX = 3;
  320.  
  321.   readonly attribute unsigned short process;
  322.   readonly attribute AString namespace;
  323. };
  324.  
  325. [scriptable, uuid(3c14a031-6f4e-11d5-9b46-000064657374)]
  326. interface nsISchemaFacet : nsISchemaComponent {
  327.   const unsigned short FACET_TYPE_LENGTH = 1;
  328.   const unsigned short FACET_TYPE_MINLENGTH = 2;
  329.   const unsigned short FACET_TYPE_MAXLENGTH = 3;
  330.   const unsigned short FACET_TYPE_PATTERN = 4;
  331.   const unsigned short FACET_TYPE_ENUMERATION = 5;
  332.   const unsigned short FACET_TYPE_WHITESPACE = 6;
  333.   const unsigned short FACET_TYPE_MAXINCLUSIVE = 7;
  334.   const unsigned short FACET_TYPE_MININCLUSIVE = 8;
  335.   const unsigned short FACET_TYPE_MAXEXCLUSIVE = 9;
  336.   const unsigned short FACET_TYPE_MINEXCLUSIVE = 10;
  337.   const unsigned short FACET_TYPE_TOTALDIGITS = 11;
  338.   const unsigned short FACET_TYPE_FRACTIONDIGITS = 12;
  339.   
  340.   const unsigned short WHITESPACE_PRESERVE = 1;
  341.   const unsigned short WHITESPACE_REPLACE = 1;
  342.   const unsigned short WHITESPACE_COLLAPSE = 1;
  343.   
  344.  
  345.   readonly attribute unsigned short facetType;
  346.   readonly attribute AString value;
  347.   readonly attribute PRUint32 lengthValue; // For length, minLength & maxLength
  348.   readonly attribute PRUint32 digitsValue; // For totalDigits & fractionDigits
  349.   readonly attribute unsigned short whitespaceValue; // For whitespace only
  350.   readonly attribute boolean isfixed;
  351. };
  352.